package com.jztchat.webSocket.service;

import com.corundumstudio.socketio.SocketIOServer;
import com.jztchat.entity.ChatRecord;
import com.jztchat.entity.ClientInfo;

/**
 * Created by zzy on 2018/1/18.
 */
public interface SocketConnectService {
    /**
     * 讲正在连接的用户信息存入redis
     * @param clientInfo
     */
    void saveClientInfoToRedis(ClientInfo clientInfo);

    /**
     * 从redis中取某个已上线的客户信息
     * @param clientId
     * @return
     */
    ClientInfo getClientInfoToRedis(String clientId);

    /**
     * 获取客户未接收到的信息
     * @param clientId
     * @return
     */
    ChatRecord getChatRecordFormRids(String clientId);

    /**
     * 存入客户未接收到的信息
     * @param clientId
     */
    void setChatRecordToRids(ChatRecord chatRecord);

    /**
     * 登陆后发送离线的消息
     * @param chatRecord
     * @param server
     */
    void sendTheMessageBefore(ChatRecord chatRecord, SocketIOServer server);
}
